package com.zkthink.ceres.promotion.enums;

import lombok.Getter;

import java.util.Arrays;
import java.util.List;

/**
 * @author 善泉 2020/6/20 16:12
 */
@Getter
public enum PromotionAuditStatusEnum {

	NONE(0,"无状态 代表选择全部"),
	AUDITING(1,"待审核"),
	APPLY_SUCCESS(2,"报名成功"),
	APPLY_FAIL(3,"报名失败"),
	CLOSED(4,"清退"),
	;

	private int code;

	private String desc;

	//审核时的状态选项
	public static List<Integer> AUDIT_STATUS_LIST = Arrays.asList(APPLY_SUCCESS.getCode(),APPLY_FAIL.getCode());

	PromotionAuditStatusEnum(int code, String desc){
		this.code = code;
		this.desc = desc;
	}

	public static PromotionAuditStatusEnum getByCode(int code){
		PromotionAuditStatusEnum[] values = PromotionAuditStatusEnum.values();
		for(PromotionAuditStatusEnum statusEnum:values){
			if(statusEnum.code==code){
				return statusEnum;
			}
		}
		return PromotionAuditStatusEnum.NONE;
	}

}
